package com.apiit.webserviceclient.activities;

import com.apiit.webserviceclient.R;
import com.apiit.webserviceclient.R.layout;
import com.apiit.webserviceclient.R.menu;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class ViewMidPoint extends Activity implements OnClickListener {

	Button back;
	TextView name;
	TextView id;
	TextView title;
	TextView supervisor;
	TextView advisor;
	TextView comment1;
	TextView comment2;
	TextView comment3;
	TextView comment4;
	TextView comment5;


	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_view_mid_point);

		back = (Button) findViewById(R.id.btnMidBack);
		name = (TextView) findViewById(R.id.txtMidName);
		id = (TextView) findViewById(R.id.txtMidStudID);
		title = (TextView) findViewById(R.id.txtMidTitle);
		supervisor = (TextView) findViewById(R.id.txtMidSupervisor);
		advisor = (TextView) findViewById(R.id.txtMidAdvisor);
		
		comment1 = (TextView) findViewById(R.id.txtMidObjectivescomments);
		comment2 = (TextView) findViewById(R.id.txtMidSuitabilitycomments);
		comment3 = (TextView) findViewById(R.id.txtMidMethodologycomments);
		comment4 = (TextView) findViewById(R.id.txtMidlanguagecomments);
		comment5 = (TextView) findViewById(R.id.txtMidAdditionalcomments);
		
		Intent intename = getIntent();
		String comment1value = intename.getStringExtra("objectiveComment");
		String comment2value = intename.getStringExtra("researchComment");
		String comment3value = intename.getStringExtra("methodologyComment");
		String comment4value = intename.getStringExtra("languageComment");
		String comment5value = intename.getStringExtra("additionalComments");
		
		String namevalue = intename.getStringExtra("studName");
		String idvalue = intename.getStringExtra("studID");
		String titlevalue = intename.getStringExtra("title");
		String supervisorvalue = intename.getStringExtra("supervisor");
		String advisorvalue = intename.getStringExtra("advisor");
		
		name.setText(namevalue);
		id.setText(idvalue);
		title.setText(titlevalue);
		supervisor.setText(supervisorvalue);
		advisor.setText(advisorvalue);
		
		comment1.setText(comment1value);
		comment2.setText(comment2value);
		comment3.setText(comment3value);
		comment4.setText(comment4value);
		comment5.setText(comment5value);

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.view_mid_point, menu);
		return true;
	}

	public void onClick(View v) {
		// TODO Auto-generated method stub
		if (v == back) {
			Intent i = new Intent(this, Pagol.class);
			startActivity(i);
		}
	}

}
